package adavance.thread;
import java.util.*;
import java.sql.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class Test {
    public static void main(String[] args) {
        java.sql.Date d=null;

        Pmcraven pm1=new Pmcraven("one");
        pm1.run();
        Pmcraven pm2=new Pmcraven("two");
        pm2.run();
    }
}

class Pmcraven extends Thread{
    private String sTname="";

    Pmcraven(String s){
        sTname=s;
    }

    public void run(){
        for (int i=0;i<2;i++){
            try {
                sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            yield();
            System.out.println(sTname);
        }
    }
}
